﻿#include <QApplication>

#include "logqueue.h"
#include "mainwindow.h"

#define MY_TEST_MODE        // 单独启动测试
#include <QMessageBox>
#include <QDebug>

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);

#ifdef MY_TEST_MODE
    int rights = 63;
#else
    Q_ASSERT(argc == 3);
    if (0 != QString(argv[1]).compare("GRD_KJ_CM")) {
        qFatal("没有进入密钥！");
        return -1;
    }

    bool isOk = false;
    int rights = QString(argv[2]).toInt(&isOk);
    if (!isOk) {
        qFatal("不是有效的参数！");
        return -1;
    }
#endif // MY_TEST_MODE

    QList<bool> tmp;
    for (int i = 0; i < 5; ++i) {
        auto num = rights & (int)std::pow(2, i);
        tmp.append(num);
    }

    MainWindow w(tmp);
    w.show();

    return a.exec();
}
